﻿@using Library
@model Ecommerce.Models.PageImageViewModel

@{
    var avatarText = string.Empty;
    if (Model.IsExtraSmallAvatar)
    {
        avatarText = "Extra small avatar";
    }
    else if (Model.IsSmallAvatar)
    {
        avatarText = "Small avatar";
    }
    else if (Model.IsMediumAvatar)
    {
        avatarText = "Medium avatar";
    }
    else if (Model.IsLargeAvatar)
    {
        avatarText = "Large avatar";
    }
}

<div class="media" data-src="@Model.Src">
    <div class="media-left">
        <a href="@Model.Src" target="_blank" title="@NOWCulture.GetString("View with original size")">
            <img class="lazy media-object img-thumbnail" width="128" data-src="@Model.Src" alt="@Model.AltText">
        </a>
    </div>
    <div class="media-body">
        <h4 class="media-heading">@Model.AltText @Html.Raw(string.IsNullOrEmpty(avatarText) ? "" : string.Format("<small>({0})</small>", NOWCulture.GetString(avatarText)))</h4>
        <p>@Model.Caption</p>
        <button type="button" class="btn btn-sm btn-primary" data-editor="edit" data-refid="@Model.PageId" data-imgsrc="@Model.Src"><span class="glyphicon glyphicon-edit"></span>@NOWCulture.GetString("Edit")</button>
        <button type="button" class="btn btn-sm btn-danger" data-editor="remove" data-refid="@Model.PageId" data-imgsrc="@Model.Src"><span class="glyphicon glyphicon-remove"></span>@NOWCulture.GetString("Remove")</button>
    </div>
</div>
